# 启动django
import os
import sys
import django

base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'indent_system.settings')
django.setup()  # 伪造让django启动

from web import models
from utils.encrypt import md5

# 创建级别
level_object = models.Level.objects.create(title="VIP", percent=90)
level_object2 = models.Level.objects.create(title="银河教育", percent=100)
level_object3 = models.Level.objects.create(title="高级代理", percent=50)
level_object4 = models.Level.objects.create(title="合伙人", percent=48)
level_object5 = models.Level.objects.create(title="管理员", percent=1)
models.Customer.objects.create(
    username='zhangya',
    password=md5("zhangya"),
    mobile='1999999999',
    level_id=1,
    creator_id=1
)
models.Customer.objects.create(
    username='xinchen',
    password=md5("xinchen"),
    mobile='1999999998',
    level_id=1,
    creator_id=1
)